/*************************************************************************
	> File Name: oj-166_newinsert_string.c
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年10月21日 星期三 19时57分20秒
 ************************************************************************/

#include <stdio.h>
#include <string.h>

int main() {
    char a[10000] = {0}, b[10000] = {0}, newstr[20001] = {0};
    int n, index;
    size_t l;
    scanf("%[^\n]", a);
    scanf("%d", &n);
    getchar();
    scanf("%[^\n]", b);
    l = strlen(b);
    for (int i = 0; i < n - 1; ++i) {
        newstr[i] = a[i];
    }
    for (int i = 0; i < l; ++i) {
        newstr[n - 1 + i] = b[i];
    }
    char *p = &a[0] + n - 1, *q = &newstr[0] + n + l - 1;
    while (*p != '\0') {
        *q = *p;
        q++, p++;
    }
    l = strlen(newstr);
    for (int i = 0; i < l; ++i) {
        if (newstr[l - 1 - i] == 'x') {
            index = i + 1;
            break;
        }
    }
    l = strlen(a);
    printf("%ld\n", l > 100 ? 100 : l);
    printf("%s\n", newstr);
    printf("%d", index);
    return 0;
}
